﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.MarketUI {
    import flash.events.*;
    import Engine.Managers.*;
    import flash.display.*;
    import Events.*;
    import org.aswing.*;
    import Classes.*;
    import Classes.sim.*;
    import Classes.doobers.*;
    import flash.text.*;
    import Classes.inventory.*;
    import Display.aswingui.*;
    import com.zynga.skelly.util.*;
    import Display.MarketUI.assets.*;

    public class TooltipFactory {

        private static var s_instance:TooltipFactory = null;

        protected var m_titleText:AssetPane;
        protected var m_hr:AssetPane;
        protected var m_titleTextField:TextField;
        protected var m_ttbg:DisplayObject;
        protected var m_centerHrPanel:JPanel;
        protected var m_animateRelative:String;
        protected var m_levelProgressComponent:SimpleProgressBar;

        public function TooltipFactory(){
            if (TooltipFactory.s_instance != null){
                throw (new Error("Attempting to instantiate more than one TooltipFactory"));
            };
            this.initializeResuableComponents();
        }
        public static function getInstance():TooltipFactory{
            if (!TooltipFactory.s_instance){
                TooltipFactory.s_instance = new (TooltipFactory)();
            };
            return (s_instance);
        }

        private function initializeResuableComponents():void{
            this.m_ttbg = (new EmbeddedArt.mkt_pop_info() as DisplayObject);
            var _local1:DisplayObject = (new EmbeddedArt.mkt_rollover_horizontalRule() as DisplayObject);
            _local1.width = (this.m_ttbg.width - 10);
            this.m_hr = new AssetPane(_local1);
            this.m_titleText = ASwingHelper.makeMultilineCapsText("", (this.m_ttbg.width - 10), EmbeddedArt.TITLE_FONT, TextFormatAlign.CENTER, 16, EmbeddedArt.brownTextColor);
            this.m_titleTextField = (this.m_titleText.getAsset() as TextField);
            this.m_centerHrPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            this.m_hr.setPreferredWidth(this.m_ttbg.width);
            this.m_centerHrPanel.appendAll(ASwingHelper.horizontalStrut(5), this.m_hr);
        }
        public function createDescriptionTooltip(_arg1:JPanel, _arg2:String, _arg3:String, _arg4:String=null):JPanel{
            var _local9:Object;
            var _local5:JPanel = this.getFilteredTitle(_arg2);
            var _local6:JPanel;
            var _local7:JPanel;
            var _local8:Object = new Object();
            _local8.type = TooltipType.DESCRIPTION;
            _local8.ttbgWidth = this.m_ttbg.width;
            _local8.content = _arg3;
            _local6 = this.createTooltip(_local8);
            if (_arg4 != null){
                _local9 = new Object();
                _local9.type = TooltipType.REQUIREMENT;
                _local9.ttbgWidth = this.m_ttbg.width;
                _local9.content = _arg4;
                _local7 = this.createTooltip(_local9);
            };
            _arg1.appendAll(_local5, this.m_centerHrPanel, _local6, _local7);
            return (_arg1);
        }
        public function createBusinessTooltip(_arg1:JPanel, _arg2:String, _arg3:Item, _arg4:String=null, _arg5:int=-1, _arg6:int=-1):JPanel{
            var _local15:Object;
            var _local16:Number;
            var _local17:Object;
            var _local18:Object;
            var _local7:JPanel = this.getFilteredTitle(_arg2);
            var _local8:JPanel;
            var _local9:JPanel;
            if (((Global.player.isEligibleForBusinessUpgrades()) && (!((_arg5 == -1))))){
                if (((_arg3.canCountUpgradeActions()) || ((_arg5 > 1)))){
                    _local15 = new Object();
                    _local15.type = TooltipType.STARS;
                    _local15.title = ZLoc.t("Dialogs", "TT_Upgrade_Level");
                    _local15.numStars = _arg5;
                    _local8 = this.createTooltip(_local15);
                };
                if (_arg3.canCountUpgradeActions()){
                    _local16 = Number(_arg3.upgrade.requirements.getRequirementValue(Requirements.REQUIREMENT_UPGRADE_ACTIONS));
                    _local17 = new Object();
                    _local17.type = TooltipType.PROGRESS_BAR;
                    _local17.title = ZLoc.t("Dialogs", "TT_Upgrade_Progress");
                    _local17.total = _local16;
                    _local17.progress = ((_arg6)!=-1) ? Math.min(_arg6, _local16) : -1;
                    _local9 = this.createTooltip(_local17);
                };
            };
            var _local10:JPanel;
            if (((!((_arg4 == null))) && (!((_arg4 == ""))))){
                _local18 = new Object();
                _local18.type = "oneLine";
                _local18.title = ZLoc.t("Dialogs", "TT_Staff");
                _local18.firstData = _arg4;
                _local10 = this.createTooltip(_local18);
            };
            var _local11:Object = new Object();
            _local11.type = "oneItem";
            _local11.title = ZLoc.t("Dialogs", "TT_Earnings");
            _local11.firstIcon = (new EmbeddedArt.mkt_coinIcon() as DisplayObject);
            _local11.firstData = String(Math.ceil((Global.player.GetDooberMinimums(_arg3, Doober.DOOBER_COIN) * _arg3.commodityReq)));
            _local11.lastLine = ZLoc.t("Dialogs", "TT_perPerson");
            var _local12:JPanel = this.createTooltip(_local11);
            var _local13:Object = new Object();
            _local13.type = "oneItemwLine";
            _local13.title = ZLoc.t("Dialogs", "TT_SupplyReq");
            if (_arg3.commodityName == Commodities.GOODS_COMMODITY){
                _local13.firstIcon = (new EmbeddedArt.mkt_goodsIcon() as DisplayObject);
                _local13.firstData = String(_arg3.commodityReq);
            } else {
                if (_arg3.commodityName == Commodities.PREMIUM_GOODS_COMMODITY){
                    _local13.firstIcon = (new EmbeddedArt.mkt_premiumGoodsIcon() as DisplayObject);
                    _local13.firstData = String(_arg3.commodityReq);
                };
            };
            _local13.lastLine = ZLoc.t("Dialogs", "TT_perPerson");
            var _local14:JPanel = this.createTooltip(_local13);
            _arg1.appendAll(_local7, this.m_centerHrPanel, _local10, _local12, _local14, _local8, _local9);
            return (_arg1);
        }
        private function getFilteredTitle(_arg1:String):JPanel{
            var _local4:String;
            var _local5:JPanel;
            var _local2 = 16;
            var _local3:Array = _arg1.split(" ");
            for each (_local4 in _local3) {
                if (_local4.length >= 13){
                    _local2 = 12;
                };
            };
            this.m_titleText = ASwingHelper.makeMultilineCapsText(_arg1, (this.m_ttbg.width - 15), EmbeddedArt.TITLE_FONT, TextFormatAlign.CENTER, _local2, EmbeddedArt.orangeTextColor);
            _local5 = ASwingHelper.centerElement(this.m_titleText);
            return (_local5);
        }
        public function createTooltip(_arg1:Object):JPanel{
            var _local4:JLabel;
            var _local7:JLabel;
            var _local8:JTextField;
            var _local9:JTextField;
            var _local11:JLabel;
            var _local12:Array;
            var _local13:int;
            var _local14:int;
            var _local15:Array;
            var _local16:String;
            var _local17:String;
            var _local18:int;
            var _local19:AssetPane;
            var _local20:AssetPane;
            var _local21:JPanel;
            var _local22:Sprite;
            var _local23:uint;
            var _local24:int;
            var _local25:AssetPane;
            var _local26:Object;
            var _local27:JPanel;
            var _local28:Object;
            var _local29:JPanel;
            var _local30:Object;
            var _local31:JPanel;
            var _local32:Array;
            var _local33:String;
            var _local34:int;
            var _local35:Object;
            var _local36:JPanel;
            var _local37:JPanel;
            var _local38:String;
            var _local39:int;
            var _local40:JPanel;
            var _local41:int;
            var _local42:int;
            var _local43:String;
            var _local44:String;
            var _local45:JPanel;
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP, 0);
            var _local3:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            var _local5:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.LEFT);
            var _local6:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.LEFT);
            var _local10:Item = _arg1.dataItem;
            switch (_arg1.type){
                case TooltipType.ONE_ITEM:
                    _local18 = 16;
                    if (String(_arg1.firstData).length >= 10){
                        _local18 = 12;
                    };
                    _local8 = ASwingHelper.makeTextField(String(_arg1.firstData), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, _local18, EmbeddedArt.greenTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), new AssetPane(_arg1.firstIcon), _local8);
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.append(_local5);
                    break;
                case TooltipType.ONE_ITEM_W_LINE:
                    _local8 = ASwingHelper.makeTextField(String(_arg1.firstData), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 16, EmbeddedArt.redTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), new AssetPane(_arg1.firstIcon), _local8);
                    _local6.appendAll(ASwingHelper.horizontalStrut(10), _local7);
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.append(_local5);
                    _local2.append(_local6);
                    break;
                case TooltipType.ONE_LINE:
                    _local7 = ASwingHelper.makeLabel(String(_arg1.firstData), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 11, EmbeddedArt.brownTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), _local7);
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.append(_local5);
                    break;
                case TooltipType.INDENTED_DESCRIPTOR:
                    _local7 = ASwingHelper.makeLabel(("   " + String(_arg1.firstData)), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 11, EmbeddedArt.lightGrayTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), _local7);
                    _local2.append(_local5);
                    break;
                case TooltipType.TWO_ITEMS:
                    _local8 = ASwingHelper.makeTextField(String(_arg1.firstData), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 16, EmbeddedArt.greenTextColor);
                    _local7 = ASwingHelper.makeLabel(String(_arg1.lastLine), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 11, EmbeddedArt.brownTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), new AssetPane(_arg1.firstIcon), _local8, _local7);
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.appendAll(_local5);
                    break;
                case TooltipType.DESCRIPTION:
                    _local19 = ASwingHelper.makeMultilineText(String(_arg1.content), (_arg1.ttbgWidth - 20), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.LEFT, 11, EmbeddedArt.brownTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), _local19);
                    _local2.append(_local5);
                    break;
                case TooltipType.REQUIREMENT:
                    _local20 = ASwingHelper.makeMultilineText(String(_arg1.content), (_arg1.ttbgWidth - 20), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.LEFT, 11, EmbeddedArt.blueTextColor);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), _local20, ASwingHelper.horizontalStrut(10), _local7);
                    _local2.append(_local5);
                    break;
                case TooltipType.SALE:
                    _local8 = ASwingHelper.makeTextField(String(_arg1.firstData), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 16, EmbeddedArt.fadedBrownTextColor);
                    _local9 = ASwingHelper.makeTextField(String(_arg1.lastLine), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 16, EmbeddedArt.greenTextColor);
                    _local21 = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.LEFT, 0);
                    _local21.appendAll(_local8, _local9);
                    _local5.appendAll(ASwingHelper.horizontalStrut(10), new AssetPane(_arg1.firstIcon), _local21);
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.TEXT_SALE_COLOR, JLabel.LEFT);
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.append(_local5);
                    _local22 = new Sprite();
                    _local22.graphics.beginFill(0xFF0000, 1);
                    _local22.graphics.drawRect(0, (_local8.getHeight() / 2), ((_local8.getWidth() * 4) / 5), 2);
                    _local22.graphics.endFill();
                    _local5.addChild(_local22);
                    _local22.x = 42;
                    _local22.y = -2;
                    break;
                case TooltipType.CHECKMARK_W_LINE:
                    _local23 = (_arg1.hasOwnProperty("firstColor")) ? _arg1.firstColor : EmbeddedArt.redTextColor;
                    _local8 = ASwingHelper.makeTextField((String(_arg1.firstData) + " "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 11, _local23);
                    if (_arg1.isComplete){
                        _local5.appendAll(ASwingHelper.horizontalStrut(10), new AssetPane(new EmbeddedArt.mkt_checkmark()));
                    } else {
                        _local5.appendAll(ASwingHelper.horizontalStrut(25));
                    };
                    _local5.append(_local8);
                    _local2.append(_local5);
                    break;
                case TooltipType.EMPTY_LOT:
                    _local2.append(this.doEmptyLotToolTip(_arg1.ttbgWidth));
                    break;
                case TooltipType.PROGRESS_BAR:
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
                    if (_arg1.progress != -1){
                        if (!this.m_levelProgressComponent){
                            this.m_levelProgressComponent = new SimpleProgressBar(EmbeddedArt.darkBlueToolTipColor, EmbeddedArt.UPGRADE_HIGHLIGHT_COLOR, 90, 10, 2, -5);
                        };
                        this.m_levelProgressComponent.setBgAlpha(1);
                        this.m_levelProgressComponent.setBgColor(2450817);
                        this.m_levelProgressComponent.setProgressRatio(_arg1.progress, _arg1.total);
                        _local5.appendAll(ASwingHelper.horizontalStrut(3), this.m_levelProgressComponent);
                    };
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.appendAll(_local5);
                    break;
                case TooltipType.STARS:
                    _local4 = ASwingHelper.makeLabel(_arg1.title, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
                    if (_arg1.numStars){
                        _local24 = 0;
                        while (_local24 < _arg1.numStars) {
                            _local25 = new AssetPane((new EmbeddedArt.mkt_masteryStar() as DisplayObject));
                            _local5.appendAll(ASwingHelper.horizontalStrut(10), _local25);
                            _local24++;
                        };
                    };
                    _local3.appendAll(ASwingHelper.horizontalStrut(5), _local4);
                    _local2.append(_local3);
                    _local2.appendAll(_local5);
                    break;
                case TooltipType.STARTER_PACK:
                    if ((((_arg1.dataItem == null)) || ((_arg1.contentPanel == null)))){
                        return (null);
                    };
                    _local26 = new Object();
                    _local26.type = TooltipType.ONE_ITEM;
                    _local26.title = ZLoc.t("Dialogs", "TT_Energy");
                    _local26.firstIcon = (new EmbeddedArt.mkt_energyIcon() as DisplayObject);
                    _local26.firstData = String(_local10.energyRewards);
                    _local27 = this.createTooltip(_local26);
                    _local28 = new Object();
                    _local28.type = TooltipType.ONE_ITEM;
                    _local28.title = ZLoc.t("Dialogs", "TT_Cash");
                    _local28.firstIcon = (new EmbeddedArt.icon_cash() as DisplayObject);
                    _local28.firstData = String(_local10.cashRewards);
                    _local29 = this.createTooltip(_local28);
                    _local30 = new Object();
                    _local30.type = TooltipType.ONE_ITEM;
                    _local30.title = ZLoc.t("Dialogs", "TT_Coins");
                    _local30.firstIcon = (new EmbeddedArt.mkt_coinIcon() as DisplayObject);
                    _local30.firstData = String(_local10.coinRewards);
                    _local30.lastLine = CardUtil.localizeTimeLeftLanguage(_local10.growTime);
                    _local31 = this.createTooltip(_local30);
                    _local32 = _local10.itemRewards;
                    _local33 = "";
                    while (_local34 < _local32.length) {
                        _local38 = _local32[_local34];
                        _local33 = (_local33 + ZLoc.t("Items", (_local38 + "_friendlyName")));
                        if (_local34 < (_local32.length - 1)){
                            _local33 = (_local33 + ", ");
                        };
                        _local34++;
                    };
                    _local35 = new Object();
                    _local35.type = TooltipType.ONE_ITEM;
                    _local35.title = ZLoc.t("Dialogs", "TT_Items");
                    _local35.firstData = _local33;
                    _local36 = this.createTooltip(_local35);
                    _local37 = _arg1.contentPanel;
                    _local37.appendAll(_local27, _local29, _local31, _local36);
                    break;
                case TooltipType.MYSTERY_CRATE:
                    if ((((_arg1.dataItem == null)) || ((_arg1.contentPanel == null)))){
                        return (null);
                    };
                    _local12 = _arg1.dataItem.randomRewards;
                    _local13 = 2;
                    _local14 = (_local12.length / 2);
                    _local15 = [];
                    _local16 = ZLoc.t("Items", "mystery_crate_tooltip_subText");
                    _local11 = ASwingHelper.makeLabel(_local16, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 14, EmbeddedArt.blueTextColor);
                    _local2.append(_local11);
                    _local17 = Global.getAssetURL("assets/dialogs/mystery_crate_anim70x74.png");
                    this.m_animateRelative = "assets/dialogs/mystery_crate_anim70x74.png";
                    if (!Catalog.assetDict[this.m_animateRelative]){
                        LoadingManager.load(_local17, this.slotCallBack);
                    };
                    _local39 = 0;
                    while (_local39 < _local13) {
                        _local40 = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
                        _local41 = 0;
                        while (_local41 < _local14) {
                            _local42 = ((_local14 * _local39) + _local41);
                            _local43 = ZLoc.t("Items", (_local12[_local42].name + "_friendlyName"));
                            _local44 = this.getShortItemInfo(_local12[_local42]);
                            _local45 = this.itemCell(_local12[_local42], _local43, _local44, _local12[_local42].iconRelative);
                            _local40.append(_local45);
                            _local41++;
                        };
                        if (_local39 == (_local13 - 1)){
                            ASwingHelper.setEasyBorder(_local40, 8, 5, 8, 5);
                        } else {
                            ASwingHelper.setEasyBorder(_local40, 8, 5, 0, 5);
                        };
                        _local2.append(_local40);
                        _local39++;
                    };
                    ASwingHelper.setEasyBorder(_local6, 8, 5, 8, 5);
                    break;
            };
            return (_local2);
        }
        private function getShortItemInfo(_arg1:Item):String{
            var _local3:Number;
            var _local2 = "";
            switch (_arg1.type){
                case "decoration":
                    _local2 = ZLoc.t("Dialogs", "TT_MC_Payout", {amount:_arg1.bonusPercent});
                    break;
                case "business":
                    _local3 = Math.ceil((Global.player.GetDooberMinimums(_arg1, Doober.DOOBER_COIN) * _arg1.commodityReq));
                    _local2 = ZLoc.t("Dialogs", "TT_MC_Earnings", {amount:_local3});
                    break;
                case "residence":
                    _local2 = ZLoc.t("Dialogs", "TT_MC_Population", {
                        base:(10 * _arg1.populationBase),
                        max:(10 * _arg1.populationMax)
                    });
                    break;
                default:
                    _local2 = "Not found";
            };
            return (_local2);
        }
        private function slotCallBack(_arg1:Event):void{
            var _local3:Bitmap;
            var _local2:Loader = (_arg1.target.loader as Loader);
            if ((_local2.content is Bitmap)){
                _local3 = (_local2.content as Bitmap);
                Catalog.assetDict[this.m_animateRelative] = _local3;
            };
        }
        protected function createIconPane(_arg1:Item, _arg2:String, _arg3:DisplayObject):JPanel{
            var iconPane:* = null;
            var iconInnerPane:* = null;
            var itemName:* = null;
            var iconLoader:* = null;
            var offy:* = NaN;
            var offx:* = NaN;
            var iconItem:* = _arg1;
            var iconRelativePath:* = _arg2;
            var bkgAsset:* = _arg3;
            iconPane = new AssetPane();
            var iconString:* = Global.getAssetURL(iconRelativePath);
            iconInnerPane = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            itemName = iconItem.name;
            if (!Catalog.assetDict[itemName]){
                iconLoader = LoadingManager.load(iconString, Curry.curry(function (_arg1:JPanel, _arg2:Event):void{
                    var _local3:*;
                    var _local4:*;
                    iconPane.setAsset(iconLoader.content);
                    ASwingHelper.prepare(_arg1);
                    if (bkgAsset){
                        _local3 = (Math.abs((bkgAsset.height - iconLoader.content.height)) / 2);
                        _local4 = (Math.abs((bkgAsset.width - iconLoader.content.width)) / 2);
                        ASwingHelper.setEasyBorder(iconInnerPane, _local3, _local4, _local3, _local4);
                    };
                    Catalog.assetDict[itemName] = iconLoader.content;
                    _arg1.dispatchEvent(new UIEvent(UIEvent.REFRESH_DIALOG, "iconLoaded", true));
                }, iconInnerPane));
            } else {
                iconPane.setAsset(Catalog.assetDict[itemName]);
                ASwingHelper.prepare(iconInnerPane);
                if (bkgAsset){
                    offy = (Math.abs((bkgAsset.height - Catalog.assetDict[itemName].height)) / 2);
                    offx = (Math.abs((bkgAsset.width - Catalog.assetDict[itemName].width)) / 2);
                    ASwingHelper.setEasyBorder(iconInnerPane, offy, offx, offy, offx);
                };
            };
            iconInnerPane.append(iconPane);
            return (iconInnerPane);
        }
        protected function itemCell(_arg1:Item, _arg2:String, _arg3:String, _arg4:String):JPanel{
            var _local5:Class = Catalog.assetDict["card_available_unselected"];
            var _local6:DisplayObject = (new (_local5)() as DisplayObject);
            var _local7:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 0);
            var _local8:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 0);
            var _local9:JPanel = this.createIconPane(_arg1, _arg4, _local6);
            var _local10:JLabel = ASwingHelper.makeLabel(_arg2, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 11, EmbeddedArt.brownTextColor);
            var _local11:JLabel = ASwingHelper.makeLabel(_arg3, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 11, EmbeddedArt.brownTextColor);
            ASwingHelper.setSizedBackground(_local8, _local6);
            _local8.append(_local9);
            _local7.appendAll(_local8, _local10, ASwingHelper.verticalStrut(-2), _local11);
            ASwingHelper.setEasyBorder(_local7, 0, 9, 0, 9);
            return (_local7);
        }
        private function doEmptyLotToolTip(_arg1:Number):JPanel{
            var _local9:AssetPane;
            var _local10:AssetPane;
            var _local11:AssetPane;
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP, 0);
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local4:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local5:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local6 = "";
            var _local7 = "";
            var _local8 = "";
            if (BuyLogic.isAtMaxFranchiseCount()){
                _local6 = ZLoc.t("Dialogs", "EmptyLot_MaxedOut", {maxnum:BuyLogic.maxFranchiseCount});
                _local9 = ASwingHelper.makeMultilineText(_local6, (_arg1 - 30), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.LEFT, 11, EmbeddedArt.redTextColor);
                _local3.append(_local9);
                _local2.appendAll(_local3);
                return (_local2);
            };
            _local6 = ZLoc.t("Dialogs", "FranchiseLimit", {
                numItems:BuyLogic.getFranchisesCount(Global.player.uid),
                totalLimit:BuyLogic.maxAllowedFranchiseCount
            });
            _local9 = ASwingHelper.makeMultilineText(_local6, (_arg1 - 30), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.LEFT, 11, EmbeddedArt.brownTextColor);
            _local3.append(_local9);
            _local2.appendAll(_local3);
            return (_local2);
        }

    }
}//package Display.MarketUI 
